package com.weic.easycache.framework;


import android.app.Service;
import android.content.Intent;

public abstract class DataService extends Service {
	private DataManager mDManager;
	
	@Override
	public void onCreate() {
		super.onCreate();
		mDManager = new DataManager(this);
		mDManager.onCreate();
	}
	
	public DataManager getDataManager() {
		return mDManager;
	}
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		mDManager.onRestart();
		return super.onStartCommand(intent, flags, startId);
	}
	
	@Override
	public void onDestroy() {
		mDManager.onStop();
		mDManager.onDestroy();
		mDManager = null;
		super.onDestroy();
	}
}
